import {LOGIN_SUCCESS, LOGIN_FETCH_SUCESS, LOGIN_FETCH_FAIL} from '../contants/ActionTypes'

const initialState = {
    myAccount:
        {
        isSuccess : 0,
        uid : "-1"
        }
}


export default function login(state = initialState, action){
    switch(action.type){
        case LOGIN_FETCH_SUCESS:
            return {
                ...state,
                myAccount:{
                    isSuccess : 1,
                    uid : 1
                    //uid : action.result.uid,
                   // nickname: action.result.nickname
                    }
            }
        case LOGIN_FETCH_FAIL:
            return{
                ...state,
                myAccount:{
                    isSuccess:2
                }
            }
        default:
            return state;            
    }   

}
